<link href="../addons/jy_commission/custom/templates/mobile/style.css?v=201705251730" rel="stylesheet">
<div class="fui-page fui-page-current page-commission-down" ng-init="pagedata.get_list()">
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click='goback()'></a>
        </div>
        <div class="title">{{pagedata.setting.agent_tagent || '我的团'}}({{pagedata.agent_num}}个)</div>
    </div>
    <div class="fui-content">
      
        <div class="fui-tab fui-tab-warning" id="tab">
            <a ng-repeat="(level,value) in pagedata.levels" ng-click="pagedata.list=[];pagedata.loaded=false;pagedata.params.page=1;pagedata.params.level=level;pagedata.get_list()" ng-class="{'active':pagedata.params.level==level}" href="javascript:;">{{value.title}}({{value.num}})</a>
        </div>
        <div  class="fui-list-group" id="container" >
		<div ng-repeat="item in pagedata.list track by item.mid" class="fui-list" style="height: 3.5rem">
			<div class="fui-list-media">
				<img ng-if="item.member.avatar" ng-src="{{tomedia(item.member.avatar)}}" class="round" style="width:2rem;height:2rem">
				<i ng-if="!item.member.avatar" class="icon icon-my2"></i>
			</div>
			<div class="fui-list-inner">
				<div class="row">
				      <div class="row-text" >				 
					  <i ng-if="item.is_agent" class="icon icon-star text-danger"></i>
					 {{item.member.nickname}}
				      </div>
				</div>
				<div ng-if="item.is_agent==1" class="subtitle">
				    成为{{pagedata.setting.agent_title || '代理'}}时间: {{date(item.check_time)}}
				    
				    
				</div>
				<div ng-if="item.is_agent!=1" class="subtitle">
				    注册时间:{{date(item.createtime)}}
				</div>
			</div>
			<div ng-if="item.is_agent" class="row-remark">
				<p>{{item.member_num}}个成员</p>

			</div>
			<div ng-if="!item.is_agent" class="row-remark">
				
				<p>消费: {{item.moneycount}}元</p>
				<p>{{item.ordercount}}个订单</p>

			</div>
		</div>
		</div>
		<div class='infinite-loading' style="display:none" id="loading_show"><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
		<div ng-if="pagedata.list.length==0" class='content-empty' >
			<!--<i class='icon icon-group'></i><br/>暂时没有任何数据-->
			<img src="../core/resource/images/nomeb.png" style="width: 6rem;margin-bottom: .5rem;"><br/><p style="color: #999;font-size: .75rem">暂时没有任何数据</p>
		</div>

    </div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.get_list=function(){
	if(scope.pagedata.loading || scope.pagedata.loaded){
		return;
	}
	scope.pagedata.loading=true;
	$('#loading_show').show();
	var query=scope.made_query(scope.pagedata.params);
	scope.get('//list/'+query,function(res){
		scope.pagedata.loading=false;
		$('#loading_show').hide();
		if(res=='none'){
			scope.pagedata.loaded=true;
			return;
		}
		if(!Array.isArray(res)){
			scope.message('获取数据失败！');
			return;
		}
		if(res.length<scope.pagedata.psize){
			scope.pagedata.loaded=true;
		}
		if(!scope.pagedata.list){
			scope.pagedata.list=[];
		}
		res.forEach(function(row){
			scope.pagedata.list.push(row);
		});
		scope.pagedata.params.page++;
		
	});
}
scope.pagedata.scroll_bottom=function(){
	scope.pagedata.get_list();
}
</script>

